package com.jyg.common.base;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

@Service
public class BaseServiceImpl<M extends BaseMapper<T>, T extends BaseEntity> extends ServiceImpl<M, T> implements IService<T> {

    @Override
    public boolean save(T entity) {
        entity.create();
        return IService.super.save(entity);
    }

    @Override
    public boolean updateById(T entity) {
        entity.update();
        return IService.super.updateById(entity);
    }
}
